package com.ymatou.iapi.ocr.testcase;

import java.io.File;
import java.io.IOException;
import java.util.Map;

import org.apache.http.client.ClientProtocolException;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.google.zxing.BarcodeFormat;
import com.ymatou.iapi.ocr.parameter.ChangeWxUrlStatusBean;
import com.ymatou.iapi.ocr.parameter.WeiXinCheckBean;
import com.ymatou.iapi.ocr.service.ChangeWxUrlStatusCall;
import com.ymatou.iapi.ocr.service.WeiXinCheckCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.database.sqlwapper.OCRWrapper;
import com.ymttest.utils.TestDataManager;
/**
*微信二维码识别
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_WeiXinCheck{
	private static WeiXinCheckBean weixincheckBean;
	private static WeiXinCheckCall weixincheckCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("微信二维码识别");
	}

	@Before
	public void caseUp() {
		weixincheckBean=new WeiXinCheckBean();
		weixincheckCall=new WeiXinCheckCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(weixincheckCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_WeiXinCheck_001() {
		Logger.start(true,"传入图片识别成功,命中敏感词落库");
		try {
			String fpath = System.getProperty("user.dir") + File.separator
					+ "resource" + File.separator + "noymt.jpg";
			String u="http://u.wechat.com/1.jpg";
			TestDataManager.CreateMatrixFile(u, fpath);
			String turl=TestDataManager.UploadFile(fpath);
			weixincheckBean.setAppId("autotest");
			weixincheckBean.setBizId(TestDataManager.getRandomUUID().toString());
			weixincheckBean.setImgUrl(turl);
			weixincheckBean.setUserId(1);
			weixincheckCall.setData(weixincheckBean);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals(u, weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("qrCode").getAsString(), "验证qrCode被拦截");
			OCRWrapper test = new OCRWrapper();
			Map info = test.selectTopicWeixinByBizId(weixincheckBean.getBizId()).get(0);
	    	Logger.debug("info:"+test.selectTopicWeixinByBizId(weixincheckBean.getBizId()));
	    	Logger.verifyEquals(3, info.get("CheckStatus"), "验证Status被拦截");
	    	Logger.verifyEquals(u, info.get("QrCode"), "验证QrCode");
	    	Logger.verifyEquals(weixincheckBean.getUserId(), info.get("UserId"), "验证UserId");
	    	Logger.verifyEquals(turl, info.get("Url"), "验证url");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_WeiXinCheck_002() {
		Logger.start(true,"传入图片识别成功,未命中敏感词不落库");
		try {
			String fpath = System.getProperty("user.dir") + File.separator
					+ "resource" + File.separator + "noymt.jpg";
			String u="http://www.ymatou.com/1.jpg";
			TestDataManager.CreateMatrixFile(u, fpath);
			String turl=TestDataManager.UploadFile(fpath);
			weixincheckBean.setAppId("autotest");
			weixincheckBean.setBizId(TestDataManager.getRandomUUID().toString());
			weixincheckBean.setImgUrl(turl);
			weixincheckBean.setUserId(1);
			weixincheckCall.setData(weixincheckBean);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals("null", weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("qrCode").toString(), "验证qrCode没有被拦截");
			OCRWrapper test = new OCRWrapper();
			int size = test.selectTopicWeixinByBizId(weixincheckBean.getBizId()).size();
	    	Logger.verifyEquals(0, size, "验证不记录");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_WeiXinCheck_003() {
		Logger.start(true,"传入图片不是二维码且没有历史记录,不处理");
		try {
			String fpath = System.getProperty("user.dir") + File.separator
					+ "resource" + File.separator + "upload.gif";
			String u="http://www.ymatou.com/1.jpg";
			TestDataManager.CreateMatrixFile(u, fpath);
			String turl=TestDataManager.UploadFile(fpath);
			weixincheckBean.setAppId("autotest");
			weixincheckBean.setBizId(TestDataManager.getRandomUUID().toString());
			weixincheckBean.setImgUrl(turl);
			weixincheckBean.setUserId(1);
			weixincheckCall.setData(weixincheckBean);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals("null", weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("qrCode").toString(), "验证qrCode没有被拦截");
			OCRWrapper test = new OCRWrapper();
			int size = test.selectTopicWeixinByBizId(weixincheckBean.getBizId()).size();
	    	Logger.verifyEquals(0, size, "验证不记录");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_WeiXinCheck_004() {
		Logger.start(true,"传入图片是历史验证过的二维码且命中敏感词,返回正确");
		try {
			String fpath = System.getProperty("user.dir") + File.separator
					+ "resource" + File.separator + "noymt.jpg";
			String u="http://u.wechat.com/1.jpg";
			TestDataManager.CreateMatrixFile(u, fpath);
			String turl=TestDataManager.UploadFile(fpath);
			weixincheckBean.setAppId("autotest");
			weixincheckBean.setBizId(TestDataManager.getRandomUUID().toString());
			weixincheckBean.setImgUrl(turl);
			weixincheckBean.setUserId(1);
			weixincheckCall.setData(weixincheckBean);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals(u, weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("qrCode").getAsString(), "验证qrCode被拦截");
			OCRWrapper test = new OCRWrapper();
			Map info = test.selectTopicWeixinByBizId(weixincheckBean.getBizId()).get(0);
	    	Logger.debug("info:"+test.selectTopicWeixinByBizId(weixincheckBean.getBizId()));
	    	Logger.verifyEquals(3, info.get("CheckStatus"), "验证Status被拦截");
	    	Logger.verifyEquals(u, info.get("QrCode"), "验证QrCode");
	    	Logger.verifyEquals(weixincheckBean.getUserId(), info.get("UserId"), "验证UserId");
	    	Logger.verifyEquals(turl, info.get("Url"), "验证url");
	    	
	    	weixincheckBean.setBizId(TestDataManager.getRandomUUID().toString());
	    	weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals(u, weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("qrCode").getAsString(), "验证qrCode被拦截");
			int size= test.selectTopicWeixinByBizId(weixincheckBean.getBizId()).size();
			Logger.verifyEquals(0,size,"同一条不重复记录");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	@Ignore
	//不存在此场景 二维码交易无问题后会送去图片校验 得到结果是                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               图片是成功还是拦截
	public void Tc_WeiXinCheck_005() {
		Logger.start(true,"传入图片是历史验证过的二维码且未命中敏感词,返回正确");
		try {
			//数据库搜索出固定数据
			//select * from topicweixin where qcode is not null and status=0
			Logger.fail(new Exception("not do"));
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	private void ChangeWxurlStatusCall(int id,int status) throws ClientProtocolException, IOException {
		ChangeWxUrlStatusBean changewxurlstatusBean=new ChangeWxUrlStatusBean();
		ChangeWxUrlStatusCall changewxurlstatusCall=new ChangeWxUrlStatusCall();
		changewxurlstatusBean.setWxUrlId(id);
		changewxurlstatusBean.setWxUrlStatus(status);
		changewxurlstatusCall.setData(changewxurlstatusBean);
		changewxurlstatusCall.callService();
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_WeiXinCheck_006() {
		Logger.start(true,"传入图片是历史验证过的图片且命中敏感词,返回正确");
		try {
			//数据库搜索出固定数据
			//select * from topicweixin where ImgText is not null and status=2
			String turl="http://pic1.ymatou.com/G01/M00/3E/ED/rBBlD1xHzsKAUwD-AAABUtfzhGA265_1_1_o.gif#246x246";
			Map m =new  OCRWrapper().selectTopicWeixinByUrl(turl).get(0);
			ChangeWxurlStatusCall((int)m.get("Id"), 2);
			weixincheckBean.setAppId("autotest");
			weixincheckBean.setBizId(TestDataManager.getRandomUUID().toString());
			weixincheckBean.setImgUrl(turl);
			weixincheckBean.setUserId(1);
			weixincheckCall.setData(weixincheckBean);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyNotNull(weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("text").getAsString(), "验证text被拦截");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_WeiXinCheck_007() {
		Logger.start(true,"传入图片是历史验证过的图片且未命中敏感词,返回正确");
		try {
			//数据库搜索出固定数据
			//select * from topicweixin where ImgText is not null and status=0
			String turl="http://p6.img.ymatou.com/G01/M00/03/8F/rBBk0VXW0RSAWXtBAABODJj5O_4083_o.jpg#138x246";
			Map m =new  OCRWrapper().selectTopicWeixinByUrl(turl).get(0);
			ChangeWxurlStatusCall((int)m.get("Id"), 1);
			weixincheckBean.setAppId("autotest");
			weixincheckBean.setBizId(TestDataManager.getRandomUUID().toString());
			weixincheckBean.setImgUrl(turl);
			weixincheckBean.setUserId(1);
			weixincheckCall.setData(weixincheckBean);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals("null",weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("text").toString(), "验证text不拦截");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	//https://g.alicdn.com/idleFish-F2e/app-basic/item.html?itemid=577975570877&ut_sk=1.Wmdy4BUdfAQDAMKV7avFGw9l_12431167_1539528507966.QRCode.detail.577975570877.186627467&forceFlush=1
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_WeiXinCheck_008() {
		Logger.start(true,"传入图片识别成功,命中敏感词-闲鱼落库");
		try {
			String fpath = System.getProperty("user.dir") + File.separator
					+ "resource" + File.separator + "noymt.jpg";
			String u="https://g.alicdn.com/idleFish-F2e/app-basic/item.html?itemid=577975570877&ut_sk=1.Wmdy4BUdfAQDAMKV7avFGw9l_12431167_1539528507966.QRCode.detail.577975570877.186627467&forceFlush=1";
			TestDataManager.CreateMatrixFile(u, fpath);
			String turl=TestDataManager.UploadFile(fpath);
			weixincheckBean.setAppId("autotest");
			weixincheckBean.setBizId(TestDataManager.getRandomUUID().toString());
			weixincheckBean.setImgUrl(turl);
			weixincheckBean.setUserId(1);
			weixincheckCall.setData(weixincheckBean);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals(u, weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("qrCode").getAsString(), "验证qrCode被拦截");
			OCRWrapper test = new OCRWrapper();
			Map info = test.selectTopicWeixinByBizId(weixincheckBean.getBizId()).get(0);
	    	Logger.debug("info:"+test.selectTopicWeixinByBizId(weixincheckBean.getBizId()));
	    	Logger.verifyEquals(3, info.get("CheckStatus"), "验证Status被拦截");
	    	Logger.verifyEquals(u, info.get("QrCode"), "验证QrCode");
	    	Logger.verifyEquals(weixincheckBean.getUserId(), info.get("UserId"), "验证UserId");
	    	Logger.verifyEquals(turl, info.get("Url"), "验证url");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_WeiXinCheck_009() {
		Logger.start(true,"传入图片识别成功,各种历史状态验证");
		try {
			String fpath = System.getProperty("user.dir") + File.separator
					+ "resource" + File.separator + "noymt.jpg";
			String u="https://g.alicdn.com/idleFish-F2e/app-basic/item.html?itemid=577975570877&ut_sk=1.Wmdy4BUdfAQDAMKV7avFGw9l_12431167_1539528507966.QRCode.detail.577975570877.186627467&forceFlush=1";
			TestDataManager.CreateMatrixFile(u, fpath);
			String turl=TestDataManager.UploadFile(fpath);
			//0- 安全，1- 包含导流文本，2- 包含导流二维码
			//0- 机器识别正常（待确认）-0，1- 机器识别需要打击（待确认）-1，2- 人工确认需要打击（来自 1）-1，3- 包含打击二维码 -2  4- 人工确认需要打击（来自 0）-1，5- 人工确认正常（来自 1）-0，6- 人工确认正常（来自 0）-0
			
			weixincheckBean.setAppId("autotest");
			weixincheckBean.setBizId(TestDataManager.getRandomUUID().toString());
			weixincheckBean.setImgUrl(turl);
			weixincheckBean.setUserId(1);
			weixincheckCall.setData(weixincheckBean);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
//			Logger.verifyEquals("2", weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("checkResult").getAsString(), "验证checkResult");
			Map m =new  OCRWrapper().selectTopicWeixinByUrl(turl).get(0);
			ChangeWxurlStatusCall((int)m.get("Id"), 0);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals("0", weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("checkResult").getAsString(), "验证checkResult");
			ChangeWxurlStatusCall((int)m.get("Id"), 1);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals("0", weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("checkResult").getAsString(), "验证checkResult");
			ChangeWxurlStatusCall((int)m.get("Id"), 2);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals("1", weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("checkResult").getAsString(), "验证checkResult");
			ChangeWxurlStatusCall((int)m.get("Id"), 3);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals("2", weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("checkResult").getAsString(), "验证checkResult");
			ChangeWxurlStatusCall((int)m.get("Id"), 4);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals("1", weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("checkResult").getAsString(), "验证checkResult");
			ChangeWxurlStatusCall((int)m.get("Id"), 5);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals("0", weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("checkResult").getAsString(), "验证checkResult");
			ChangeWxurlStatusCall((int)m.get("Id"), 6);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals("0", weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("checkResult").getAsString(), "验证checkResult");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_WeiXinCheck_010() {
		Logger.start(true,"传入图片是wx群g二维码且命中敏感词,返回正确");
		try {
			String fpath = System.getProperty("user.dir") + File.separator
					+ "resource" + File.separator + "noymt.jpg";
			String u="http://weixin.qq.com/g231.jpg";
			TestDataManager.CreateMatrixFile(u, fpath);
			String turl=TestDataManager.UploadFile(fpath);
			weixincheckBean.setAppId("autotest");
			weixincheckBean.setBizId(TestDataManager.getRandomUUID().toString());
			weixincheckBean.setImgUrl(turl);
			weixincheckBean.setUserId(1);
			weixincheckCall.setData(weixincheckBean);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals(u, weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("qrCode").getAsString(), "验证qrCode被拦截");
			OCRWrapper test = new OCRWrapper();
			Map info = test.selectTopicWeixinByBizId(weixincheckBean.getBizId()).get(0);
	    	Logger.debug("info:"+test.selectTopicWeixinByBizId(weixincheckBean.getBizId()));
	    	Logger.verifyEquals(3, info.get("CheckStatus"), "验证Status被拦截");
	    	Logger.verifyEquals(u, info.get("QrCode"), "验证QrCode");
	    	Logger.verifyEquals(weixincheckBean.getUserId(), info.get("UserId"), "验证UserId");
	    	Logger.verifyEquals(turl, info.get("Url"), "验证url");
	    	
	    	weixincheckBean.setBizId(TestDataManager.getRandomUUID().toString());
	    	weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals(u, weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("qrCode").getAsString(), "验证qrCode被拦截");
			int size= test.selectTopicWeixinByBizId(weixincheckBean.getBizId()).size();
			Logger.verifyEquals(0,size,"同一条不重复记录");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_WeiXinCheck_011() {
		Logger.start(true,"传入图片是特殊二维码识别成功");
		try {
			//最初的版本此二维码解码失败
			String fpath = System.getProperty("user.dir") + File.separator
					+ "resource" + File.separator + "1.jpg";
			String u="https://u.wechat.com/MJ-voUgjExzngp_CaCaJC3U";
//			TestDataManager.CreateMatrixFile(u, fpath);
			String turl=TestDataManager.UploadFile(fpath);
			weixincheckBean.setAppId("autotest");
			weixincheckBean.setBizId(TestDataManager.getRandomUUID().toString());
			weixincheckBean.setImgUrl(turl);
			weixincheckBean.setUserId(1);
			weixincheckCall.setData(weixincheckBean);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals(u, weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("qrCode").getAsString(), "验证qrCode被拦截");
			OCRWrapper test = new OCRWrapper();
			Map info = test.selectTopicWeixinByBizId(weixincheckBean.getBizId()).get(0);
	    	Logger.debug("info:"+test.selectTopicWeixinByBizId(weixincheckBean.getBizId()));
	    	Logger.verifyEquals(3, info.get("CheckStatus"), "验证Status被拦截");
	    	Logger.verifyEquals(u, info.get("QrCode"), "验证QrCode");
	    	Logger.verifyEquals(weixincheckBean.getUserId(), info.get("UserId"), "验证UserId");
	    	Logger.verifyEquals(turl, info.get("Url"), "验证url");
	    	
	    	weixincheckBean.setBizId(TestDataManager.getRandomUUID().toString());
	    	weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals(u, weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("qrCode").getAsString(), "验证qrCode被拦截");
			int size= test.selectTopicWeixinByBizId(weixincheckBean.getBizId()).size();
			Logger.verifyEquals(0,size,"同一条不重复记录");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_WeiXinCheck_012() {
		Logger.start(true,"传入图片条形码");
		try {
			String fpath = System.getProperty("user.dir") + File.separator
					+ "resource" + File.separator + "noymt.jpg";
			String u="A12345D";
			TestDataManager.CreateMatrixFile(u, fpath,BarcodeFormat.CODE_128);
			String turl=TestDataManager.UploadFile(fpath);
			weixincheckBean.setAppId("autotest");
			weixincheckBean.setBizId(TestDataManager.getRandomUUID().toString());
			weixincheckBean.setImgUrl(turl);
			weixincheckBean.setUserId(1);
			weixincheckCall.setData(weixincheckBean);
			weixincheckCall.callService();			
			Logger.verifyEquals("200", weixincheckCall.getString("Status"), "验证Status");
			Logger.verifyEquals(true,weixincheckCall.getJsonObject().get("Result").getAsJsonObject().get("qrCode").isJsonNull(), "条形码不拦截");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}